home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / common.d / util.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-10  |  2.0 KB  |  66 lines

  1. /*
  2.  *   util.h - Common utility routines for xmcd, cda and libdi.
  3.  *
  4.  *   xmcd  - Motif(tm) CD Audio Player
  5.  *   cda   - Command-line CD Audio Player
  6.  *   libdi - CD Audio Player Device Interface Library
  7.  *
  8.  *
  9.  *   Copyright (C) 1995  Ti Kan
  10.  *   E-mail: ti@amb.org
  11.  *
  12.  *   This program is free software; you can redistribute it and/or modify
  13.  *   it under the terms of the GNU General Public License as published by
  14.  *   the Free Software Foundation; either version 2 of the License, or
  15.  *   (at your option) any later version.
  16.  *
  17.  *   This program is distributed in the hope that it will be useful,
  18.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  *   GNU General Public License for more details.
  21.  *
  22.  *   You should have received a copy of the GNU General Public License
  23.  *   along with this program; if not, write to the Free Software
  24.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  25.  *
  26.  */
  27. #ifndef __UTIL_H__
  28. #define __UTIL_H__
  29.  
  30. #ifndef LINT
  31. static char *_util_h_ident_ = "@(#)util.h    5.3 94/12/28";
  32. #endif
  33.  
  34.  
  35. /* Utility macros */
  36. #define SQR(x)        ((x) * (x))    /* Compute the square of a number */
  37. #define DBGPRN        if (app_data.debug) fprintf
  38. #define DBGDUMP        if (app_data.debug) dbgdump
  39.  
  40.  
  41. /* Public function prototypes */
  42. extern void        util_init(void);
  43. extern uid_t        get_ouid(void);
  44. extern gid_t        get_ogid(void);
  45. extern sword32_t    ltobcd(sword32_t);
  46. extern sword32_t    bcdtol(sword32_t);
  47. extern bool_t        stob(char *);
  48. extern char        *basename(char *);
  49. extern char        *dirname(char *);
  50. extern char        *homedir(uid_t);
  51. extern char        *uhomedir(char *);
  52. extern int        isqrt(int);
  53. extern void        blktomsf(word32_t, byte_t *, byte_t *, byte_t *,
  54.                  word32_t);
  55. extern void        msftoblk(byte_t, byte_t, byte_t, word32_t *, word32_t);
  56. extern word16_t        bswap16(word16_t);
  57. extern word32_t        bswap24(word32_t);
  58. extern word32_t        bswap32(word32_t);
  59. extern word16_t        lswap16(word16_t);
  60. extern word32_t        lswap24(word32_t);
  61. extern word32_t        lswap32(word32_t);
  62. extern void        dbgdump(char *, byte_t *, int);
  63.  
  64. #endif    /* __UTIL_H__ */
  65.  
  66.